<template>
	<view class="bg-img">
		<view class="download_box text-center" style="margin-top:10rpx;">
			<view style="margin: 40rpx 0 10rpx;font-size: 32rpx;"></view>
			<view style="width: 366rpx;height:346rpx;margin: 0rpx auto;">
			     <canvas canvas-id="qrcode" style="width: 200px;height: 200px;" />
			</view>
			<view class="jui_flex_col_center infor-title" style="margin-top: 100rpx;">
				<button class="invBtn" @tap="$tool.h5Copy(android)">复制链接</button>
			</view>
			<view class="jui_flex_col_center infor-title">
				请扫码或复制链接下载APP
			</view>
		</view>
	</view>
</template>

<script>
	import uQRCode from '@/js_sdk/Sansnn-uQRCode/uqrcode.js'
	export default {
		data() {
			return {
				android:"",
				ios:''
			};
		},
		onLoad() {
			this.init();
		},
		methods: {
			init(){
				let _token = uni.getStorageSync('token');
				let downloadPath = 'https://www.ynbinlishenghuo.com:8080/h5/#/pages/user/download/downbowser?appDownKey=' + _token;
				this.android = downloadPath;
				this.ios = downloadPath;
				uQRCode.make({
					canvasId: 'qrcode',
					componentInstance: this,
					text: downloadPath,
					size: 200,
					margin: 10,
					foregroundColor: '#000000',
					fileType: 'jpg',
					errorCorrectLevel: uQRCode.errorCorrectLevel.H,
					success: res => {
						
					}
				})
			},
		}
	};
</script>

<style lang="scss" scoped>
	.invBtn{
		width: 80%;
		height: 72rpx;
		background-color: #ffaa00;
		border-radius: 36rpx;
		font-size: 30rpx;
		color:#fff;
		line-height: 72rpx;
	}
	.bg-img{
		position: relative;
		width: 100%;
		height: 100%;
		background:url(https://www.ynbinlishenghuo.com:1803/app/images/com.png) no-repeat center;
		background-size: 100% 100%;
		border-radius: 16rpx;
		box-shadow: 0 0 20px #3168D9;
		position: absolute;
		bottom: 0;
		left: 50%;
		transform: translate(-50%, 0);
		text-align: center;
	}
	.infor-title{
		margin: 21px;
		font-size: 18px;
		color: #fff;
		font-weight: 600;
	}
	.downloadbg{
		width: 100%;
		position: fixed;
		/* #ifdef APP-PLUS */
		height: 100vh;
		top:0px;
		/* #endif */
		/* #ifndef APP-PLUS */
		height: calc(100vh - 88rpx);
		top:0px;
		/* #endif */
		left: 0;
		bottom: 0 !important;
		right: 0;
		z-index: 1;
	}
	.download_box{
		width: 100%;
		position: fixed;
		top:155px !important;
		z-index: 5;
	}
</style>
